package com.hp.ssmp.controller;

import com.hp.ssmp.util.QiniuUtils;
import com.hp.ssmp.util.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
public class UploadController {
    @PostMapping("/upload")
    public R upload(MultipartFile file) throws IOException {
        String fileName = file.getOriginalFilename();
        R re= QiniuUtils.upload(file.getInputStream(),fileName);
        return re;
    }

}
